﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Default.Master" AutoEventWireup="true"
    CodeBehind="GioHang.aspx.cs" Inherits="MyWeb.Module.Shop.GioHang"  %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Panel runat="server" ID="pnView" Visible="true">
        <div class="headboxpro" style="margin-top: 230px">
            Chi tiết giỏ hàng</div>
        <div id='GioHangTongTien' class="GioHangTongTien">
            <asp:GridView ID="grvGioHang" runat="server" AutoGenerateColumns="False" DataKeyNames="Id"
                OnRowCommand="grvGioHang_RowCommand" Width="100%">
                <Columns>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:Label ID="lblproductid" runat="server" Text='<%# Eval("Id") %>' Visible="false"></asp:Label>
                            </td>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:TemplateField>
                    <asp:BoundField DataField="Name" HeaderText="Tên sản phẩm">
                        <ItemStyle CssClass="tensp_Cart" HorizontalAlign="Left" VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="Số lượng">
                        <ItemTemplate>
                            <asp:TextBox ID="txtSoLuong" runat="server" Width="40px" Text='<%#Eval("quantity").ToString() %>'></asp:TextBox>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Giá (VNĐ)">
                        <ItemTemplate>
                            <asp:Label ID="lblGia" runat="server" Text='<%#Eval("Price").ToString() %>' />
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Thành tiền (VNĐ)">
                        <ItemTemplate>
                            <asp:Label ID="lblTongGia" runat="server" Text=' <%#Eval("TotalPrice").ToString()%> ' />
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Chức năng">
                        <ItemTemplate>
                            <asp:ImageButton ID="imgbtncapnhat" runat="server" CommandArgument='<%# Eval("Id") %>'
                                CommandName="Update" ImageUrl="~/App_Themes/Admin/images/refresh.png" ToolTip="Cập nhật" />
                            <asp:ImageButton ID="imgbtnremove" runat="server" CommandArgument='<%# Eval("Id") %>'
                                CommandName="Delete" ImageUrl="~/App_Themes/Admin/images/delete.png" ToolTip="Hủy bỏ" />
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:TemplateField>
                </Columns>
                <HeaderStyle HorizontalAlign="Center" />
                <RowStyle HorizontalAlign="Left" />
            </asp:GridView>
            <table border="0" cellspacing="5" cellpadding="5" width="100%">
                <tr>
                    <td>
                        <asp:Label ID="lblTongTien" runat="server" ForeColor="#CC0000" Font-Bold="True" />
                    </td>
                </tr>
                <tr>
                    <td style="width: 200px">
                    </td>
                    <td>
                        <div class="detailpro">
                            <asp:LinkButton ID="btnmuatiep" runat="server" OnClick="btnmuatiep_Click">Mua Tiếp</asp:LinkButton></div>
                        &nbsp;&nbsp;<div class="detailpro">
                            <asp:LinkButton ID="btndathang" runat="server" OnClick="btndathang_Click" >Đặt Hàng</asp:LinkButton></div>
                    </td>
                </tr>
            </table>
            <asp:Label ID="lblcheck" runat="server"></asp:Label>
        </div>
    </asp:Panel>
    <asp:Panel ID="pncustomer" runat="server" Visible="false">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <div class="headboxpro">
            Thông tin khách hàng</div>
        <div class="bodyboxpro">
            <table border="0px" cellpadding="5" cellspacing="5" width="100%" class="tbgiohang"
                style="margin-left: 10px; margin-top: 5px;">
                <tr>
                    <td align="left">
                        Họ tên(*)
                    </td>
                    <td align="left" style="margin-bottom: 5px">
                        <asp:TextBox ID="txtName" runat="server" Width="300px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="rfvName" runat="server" ControlToValidate="txtName"
                            Display="Dynamic" ErrorMessage="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        Địa chỉ (*)
                    </td>
                    <td>
                        <asp:TextBox ID="txtDiaChiNM" runat="server" TextMode="SingleLine" Width="300px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtDiaChiNM"
                            Display="Dynamic" ErrorMessage="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td align="left" class="style1">
                        Điện thoại
                    </td>
                    <td class="style1">
                        <asp:TextBox ID="txtDienthoaiNM" Width="300px" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtDienthoaiNM"
                            Display="Dynamic" ErrorMessage="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        Email:
                    </td>
                    <td>
                        <asp:TextBox ID="txtEmailNM" Width="300px" runat="server"></asp:TextBox>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="*"
                            ControlToValidate="txtEmailNM" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        Thanh toán:
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlthanhtoan" Width="300px" runat="server">
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="rfvGroupNews" runat="server" ControlToValidate="ddlthanhtoan"
                            Display="Dynamic" ErrorMessage="*" SetFocusOnError="True" />
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        Yêu cầu của KH:
                    </td>
                    <td>
                        <asp:TextBox ID="txtrequest" runat="server" Width="300px" TextMode="MultiLine" Height="70px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td>
                        <div class="detailpro">
                            <asp:LinkButton ID="lblttkh" runat="server" OnClick="lblttkh_Click">Đặt hàng</asp:LinkButton>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
    </asp:Panel>
    <asp:Panel ID="pnthanhcong" runat="server" Visible="false">
        <div id="MuahangThanhCong" class="MuahangThanhCong">
            <h2>
                Cám ơn bạn đã mua hàng</h2>
            <p style="font-weight: bold; color: rgb(70, 49, 49); font-size: 16px">
                Chúng tôi sẽ chuyển hàng đến cho bạn trong vòng 24h
                <br />
                Trong trường hợp khác, nhân viên của chúng tôi sẽ thông báo cho bạn</p>
        </div>
    </asp:Panel>
</asp:Content>
